﻿using Ndns.Packet.Abstractions;
using System;
using System.Net;
using System.Threading;
using System.Threading.Tasks;

namespace Ndns.Net
{
    public interface IDnsRequestHandler
    {
        void OnStarting(IDnsServer server);
        void OnStarted(IDnsServer server);

        void OnStopping(IDnsServer server);
        void OnStopped(IDnsServer server);

        void OnFatalError(IDnsServer server, Exception ex);

        Task<DnsPacket> OnReceivedAsync(IDnsServer server, DnsPacket packet, EndPoint source, CancellationToken cancellationToken);

    }
}
